#ifndef NETWORKTOOL_H
#define NETWORKTOOL_H

#include <QString>
#include <QObject>
class NetworkTool: public QObject
{
    //Q_OBJECT

private:
    NetworkTool();
public:
    static NetworkTool& getInstance() {
        static NetworkTool instance; // 在首次调用时初始化
        return instance;
    }
public:
    bool sendGet(QString url, QString headerJson, int timeout, QString& rtn, QString &msg);
    bool sendPost(QString url,QString headerJson,QString paramJson,int timeout,QString& rtn,QString& msg);

    bool setTimeOut(int timeout);
private:
    int m_timeout;
};
#define g_net NetworkTool::getInstance()
#endif // NETWORKTOOL_H
